<?php
namespace app\admin\controller;

use app\model\Apply as ApplyModel; 
use app\common\controller\AdminBase;
use think\Loader;
use think\Request;
use think\Paginator;
use think\Url;
use think\Db;

class Apply extends AdminBase{
	
	public function index(){
		
		//$applyRow = Loader::model('Apply')->getTable();
		//var_dump($applyRow);exit;
		
		$employ = Loader::model('Apply')->getEmploy();
		//var_dump($employ);exit;
		$applyRows = Loader::model('Apply')->getStatus();
		//var_dump($applyRows);exit;
		
		$this->assign('applyRows', $applyRows);
		$this->assign('employ',$employ);
		$this->assign('pages',$employ->render());

		return $this->fetch();
	
	}

	public function add(){
		//echo 123;	
		$request = Request::instance();
		//var_dump($request);exit;
		//var_dump($request->isAjax());exit;	
			
		$params = $request->param();
		//var_dump($params);exit;
		
		$adds = Loader::model('apply')->applyAdd($params);
	
		if($adds !== false){
			return $this->success();
		}else{
			return $this->error();
		}
	
		return $this->fetch();
        		
	}
}
